<div class="col-md-12 column">
        <h3>
                <?php echo __('SEARCH_SHOWS')?>
        </h3>
        <div class="row clearfix">
                <div class="col-md-12 column">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                                <h3 class="panel-title">
                                        <?php echo __('SEARCH_FILTERS')?>
                                </h3>
                        </div>
                        <div class="panel-body">
                        <?php echo Form::open(array('method' => 'GET')); ?>
                            <div class="row clearfix">
                                    <div class="col-md-4 column">
                                        <?php echo __('TITLE')?> <?php echo Form::input('title', Input::get('title') ? Input::get('title') : '', array("class"=>"form-control", "style" => "width: 150px; display: inline-block;") ); ?>
                                    </div>
                                    <div class="col-md-3 column">
                                        <?php echo __('DATE')?>: <?php echo Form::input('date', Input::get('date') ? Input::get('date') : date('d.m.Y', time()), array("class"=>"form-control", "style" => "width: 120px; display: inline-block;", "id" => "Search_date") ); ?>
                                    </div>
                                    <div class="col-md-5 column">
                                        <?php echo __('GENRE')?>: 
                                        
                                        <?php 
                                            $genre_options = array_merge(array('0' => $language == 'lv' ? 'Visi' : 'All'), $all_genres);
                                            echo Form::select('genre', Input::get('genre') ? Input::get('genre') : '', $genre_options, array("class"=>"form-control", "style" => "width: 180px; display: inline-block")); 
                                        ?>
                                       
                                        <?php echo Form::submit('', __('SEARCH'), array("class"=>"btn btn-success pull-right") ); ?> 
                                    </div>
                            </div>
                        <?php echo Form::close(); ?>
                        </div>
                    </div>
                </div>
        </div>

        <?php 
            if(isset($shows_found)) {
                if(count($shows_found) > 0) {
                    foreach($shows_found as $show) {
                        echo 
                            '<div class="col-md-6 column pull-left"><div class="panel panel-default"><div class="panel-heading"><h3 class="panel-title"><strong>' .
                                ($language == 'lv' ? $show->get('movie')->title_lv : $show->get('movie')->title_en ) . '</strong> (' . $show->get('movie')->year . ')' .
                            '</h3></div><div class="panel-body"><p>'.
                                '<img src="../uploads/posters/' . $show->get('movie')->poster_small . '" style="float: left; margin-right: 10px;">' .
                                ( $language == 'lv' ? mb_substr($show->get('movie')->description_lv, 0, 200) : mb_substr($show->get('movie')->description_en, 0, 200) ) . '...</p><p>' . 
                                 __('SHOW_START') .':<strong> ' . date('d.m.Y H:i', $show->start_time) . '</strong>' .
                                '<p>'.
                        '<a class="btn btn-success" href="/order/new/'. $show->id .'"><span class="glyphicon glyphicon-shopping-cart"></span>&nbsp;&nbsp;'. __('PURCHASE_TICKETS') .'</a>
                        <a class="btn btn-info" href="/movie/view/'. $show->get('movie')->id .'"><span class="glyphicon glyphicon-info-sign"></span>&nbsp;&nbsp;'. __('MOVIE_INFO') .'</a>' .
                            '</div></div></div>';
                    }      
                } else {
                    echo '<p>'.__('NOT_FOUND').'</p>';
                }
            } else {
                echo '<p> '. __('APPLY_FILTERS') .' </p>';
            }
        ?>
</div>

<?php echo Asset::css('jquery-ui-timepicker-addon.css'); ?>
<?php echo Asset::js('jquery-ui-timepicker-addon.js'); ?>